<template>
   <div class="app-container">
     <el-row :gutter="20">
      <el-col :span="2" :xs="24">
        <div class="head-container">
          <div class="head-container">
            <el-tag  style="margin-bottom: 20px">规则类型选择</el-tag>
          </div>
          <el-tabs tab-position="left" v-model="voteType" @tab-click="handleNodeClick">
            <el-tab-pane :key="item.value" v-for="(item) in voteTypeDictDatas" :label="item.label" :name="item.value"  ></el-tab-pane>
          </el-tabs>
        </div>
      </el-col>
      <el-col :span="22" :xs="24">
        <voteTypeYear v-if="voteType==2" />
        <!-- <voteTypeMajor v-if="voteType==1" /> -->
      </el-col>
    </el-row>
   </div>
   
</template>

<script>
import { getVoteName } from "@/api/vote/info";
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import VoteTypeYear from './voteTypeYear.vue';
import VoteTypeMajor from './voteTypeMajor.vue';
export default {
  name: "UserResult",
  components: {
    VoteTypeYear,
    VoteTypeMajor
  },
  data() {
    return {
      // 投票名称
      voteNameList: [],
      // 类型
      voteType : "2",
      
      voteTypeDictDatas: getDictDatas(DICT_TYPE.VOTE_RULE_TYPE),
    };
  },

  methods: {
   
    handleNodeClick(tab){
      this.voteType = tab.name;
    }
  }
};
</script>
